package com.zhu.service.impl;

import com.zhu.DAO.RentDao;
import com.zhu.bean.Rent;
import com.zhu.service.RentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpSession;
import java.util.List;
import java.util.Map;

@Service("rentService")
public class RentServiceImpl implements RentService {
    @Autowired
    private RentDao rentDao;
    @Override
    public int insertRent(Rent rent) {
        return rentDao.insertRent(rent);
    }

    @Override
    public List<Rent> getAll() {
        List<Rent> rentList = rentDao.getAll();
        return rentList;
    }

    @Override
    public Rent getById(int id) {
        return rentDao.getByIdRent(id);
    }

    @Override
    public List<Rent> getByName(String nickName) {
        return rentDao.getByNickName(nickName);
    }

    @Override
    public int delById(int id) {
        return rentDao.delById(id);
    }

    @Override
    public List<Rent> getByChoose(Rent rent) {
        return rentDao.getByChoose(rent);
    }
}
